package com.spring.aop;

import org.aspectj.lang.annotation.*;

/**
 *  切面定义类
 *   注解说明：
 *    @Aspect  切面
 *    @Pointcut("execution(* com.spring.aop.*.*(..))")  切点，就是在那个地方切入，
 *    @Before("pointCut()")  前置通知
 *
 *
 */
@Aspect
public class LogAspec {

    @Pointcut("execution(* com.spring.aop.*.*(..))")
    public void pointCut(){

    }

    @Before("pointCut()")
    public void beforeLog(){
        System.out.println("beforeLog.......");
    }

    @After("pointCut()")
    public void afterLog(){
        System.out.println("afterLog.......");
    }

    @AfterReturning("pointCut()")
    public void afterReturningLog() {
        System.out.println("afterReturningLog.......");
    }

    @AfterThrowing("pointCut()")
    public void AfterThrowingLog() {
        System.out.println("afterThrowingLog.......");
    }

}
